Saute tofu pieces till light brown. Heat oil in a pan and by the sliced onion till golden brown. Grind the fried onions . to a paste and keep aside. Boil tomatoes with ginger in 3/4 cup of water. Cook till the tomatoes turn soft and pulpy. Cool it and grind to a puree. Keep aside. Grind the cashews to a paste. Heat oil in a separate pan and by the onion. paste till golden brown. Add the cashew paste and still by until the cashew paste is well blended. Mix red chilli powder.
Dhania powder and garam masala. stir occasionally and add the tomato puree. Cook for 7 minutes till oil separates. Add a cup of hot water and keep boiling on low flame for 10 minutes. Add salt and tofu piece. simmer for a few minutes and serve hot.